<%-- 
    Document   : ResultSearchUser
    Created on : Dec 8, 2012, 2:19:06 AM
    Author     : Mai Phuong
--%>

<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.util.Date"%>
<%@page import="java.util.ArrayList"%>
<%@page import="javabean.UserBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%
    ArrayList<UserBean> allUsers = (ArrayList) request.getAttribute("allUsers");
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Result Search</title>
        <link href="CSS/Site1.css" type="text/css" rel="stylesheet"/>
    </head>
    <body>
        <div class="container">
            <div class="header">
                <div class="header_top_left">
                    <%
                        Date d = new Date();
                        DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");

                        out.print(dateFormat.format(d));
                    %>
                </div>               
                <%--<div class="clear"></div>--%>
                <div class="header_main" > 
                    <script type="text/javascript">
        
                        var img1="12855184861024648803.jpg"
                        var img2="12855185051828767054.jpg"
                        var img3="1285518514197142706.jpg"
                        var img4="1285518527375730281.jpg"
                        var img5="1285518537601341394.jpg"

                        var cur=Math.round(5*Math.random())
                        if (cur<=1)
                        {
                            img=img1
                        }
                        else if (cur<=2)
                        {
                            img=img2
                        }
                        else if (cur<=3)
                        {
                            img=img3
                        }
                        else if (cur<=4)
                        {
                            img=img4
                        }        
                        else
                            img=img5
                        document.write('<div class="header_main" > <img src="Images/'+img+'"/></div>')
              
        
                    </script>
                </div>


            </div>
            <h1>Search Result</h1>
            <form name="ListOfUserForm" method="post">
                <input type="hidden" name="from" value="searchusers">
                <table width="100%">


                    <tr bgcolor="gray" bordercolor="red">
                        <td><b>User name</b></td>
                        <td><b>Password</b></td>
                        <td><b>Sex</b></td>                    
                        <td><b>Full name</b></td>                    
                        <td><b>Email</b></td>
                        <td><b>Address</b></td>
                        <td><b>Role name</b></td>

                        <td>
                            <input type="checkbox" name="selectedUser" value="">
                        </td>
                    </tr>
                    <% for (int i = 0; i < allUsers.size(); i++) {
                            UserBean currentUser = allUsers.get(i);
                    %>
                    <tr>
                        <td><a href="./ViewUserServlet?username="></a>
                            <%=currentUser.getUsername()%>
                        </td>
                        <td><%=currentUser.getPassword()%></td>
                        <td><%=currentUser.getFullname()%></td>
                        <td><%=currentUser.getSex()%></td>
                        <td><%=currentUser.getEmail()%></td>
                        <td><%=currentUser.getAddress()%></td>
                        <td><%=currentUser.getRole()%></td>
                        <td>
                            <input id="cboUser" type="checkbox" name="selectedUser" value="">
                        </td>
                    </tr>
                    <%
                        }%>

                    <tr><td colspan="10" style="text-align:center">
                            <input type="button" value="Back" onclick="history.back();">
                            <input type="button" value="Delete" onclick="onDeleteUser();">
                        <td>
                    </tr>
                </table>
            </form>
            <div style=" background-image:url(/DeAn_WebTruyen/Images/footer_bg2.jpg) ; color: #FF0000;">
                <p >
                    © Copyright . All right reserved
                    <br />
                    Email: <a href="mailto:maiphuong0403@Gmail.com"><img src="/DeAn_WebTruyen/Images/gmail-icon.gif">MaiPhuong0403@Gmail.com</a>
                <ul style="text-align: center">
                    Power by<img src="/DeAn_WebTruyen/Images/Untitled.png" />
                </ul>
                </p>

            </div>
        </div>
    </body>
</html>
